//
//  YZMSegmentView.h
//  YZMicroStock
//
//  Created by wangminhong on 16/3/23.
//  Copyright © 2016年 cqjr. All rights reserved.
//

#import <UIKit/UIKit.h>

@class YZMSegmentView;

@protocol YZMSegmentViewDelegate <NSObject>

- (void)segmentView:(YZMSegmentView *)segmentView didScrollToIndexView:(NSInteger)index;

@end

@interface YZMSegmentView : UIView{
    
    UIView *_titleView;
    UIView *_redLineView;
    UIScrollView *_contentSV;
    UIView *_containerView;
    
    NSArray *_titleArray;
    NSArray *_viewArray;
    
    NSMutableArray *_buttonArray;
    
    CGPoint _beginOffset;
}

@property (nonatomic, assign) NSInteger currentIndex;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *viewArray;
@property (nonatomic, assign) id<YZMSegmentViewDelegate> delegate;



/*继承时，无需重写*/
- (void)clickForSwitchView:(UIButton *)sender;
//- (void)refreshContrainsAtButtonIndex:(NSUInteger)buttonIndex;

/*继承时，需要重写*/
- (void)addConstraints;

/*除了手滑，点击之外的其他方式 需要触发页面滑动，可调用此方法*/
- (void)clickAtIndex:(NSInteger)index;
/*除了手滑，点击之外的其他方式 需要触发页面滑动，可调用此方法 无动画效果*/
- (void)noAnimationAtIndex:(NSInteger)index;

@end
